home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / ShutDown.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  3.5 KB  |  129 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        ShutDown.h
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1987-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __SHUTDOWN__
  18. #define __SHUTDOWN__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __MIXEDMODE__
  25.     #include <MixedMode.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. enum {
  52.     sdOnPowerOff                = 1,                            /*call procedure before power off.*/
  53.     sdOnRestart                    = 2,                            /*call procedure before restart.*/
  54.     sdOnUnmount                    = 4,                            /*call procedure before unmounting.*/
  55.     sdOnDrivers                    = 8,                            /*call procedure before closing drivers.*/
  56.     sdOnBootVolUnmount            = 16,                            /*call procedure before unmounting boot volume and VM volume but after unmounting all other volumes*/
  57.     sdRestartOrPower            = 3                                /*call before either power off or restart.*/
  58. };
  59.  
  60. #if CALL_NOT_IN_CARBON
  61. typedef CALLBACK_API( void , ShutDwnProcPtr )(short shutDownStage);
  62. /*
  63.     WARNING: ShutDwnProcPtr uses register based parameters under classic 68k
  64.              and cannot be written in a high-level language without 
  65.              the help of mixed mode or assembly glue.
  66. */
  67. typedef REGISTER_UPP_TYPE(ShutDwnProcPtr)                         ShutDwnUPP;
  68. #if OPAQUE_UPP_TYPES
  69.     EXTERN_API(ShutDwnUPP)
  70.     NewShutDwnUPP                   (ShutDwnProcPtr            userRoutine);
  71.  
  72.     EXTERN_API(void)
  73.     DisposeShutDwnUPP               (ShutDwnUPP                userUPP);
  74.  
  75.     EXTERN_API(void)
  76.     InvokeShutDwnUPP               (short                    shutDownStage,
  77.                                     ShutDwnUPP                userUPP);
  78.  
  79. #else
  80.     enum { uppShutDwnProcInfo = 0x00001002 };                         /* register no_return_value Func(2_bytes:D0) */
  81.     #define NewShutDwnUPP(userRoutine)                                 (ShutDwnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture())
  82.     #define DisposeShutDwnUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  83.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  84.     #pragma parameter InvokeShutDwnUPP(__D0, __A0)
  85.     void InvokeShutDwnUPP(short shutDownStage, ShutDwnUPP userUPP) = 0x4E90;
  86.     #else
  87.         #define InvokeShutDwnUPP(shutDownStage, userUPP)                 CALL_ONE_PARAMETER_UPP((userUPP), uppShutDwnProcInfo, (shutDownStage))
  88.     #endif
  89. #endif
  90. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  91. #define NewShutDwnProc(userRoutine)                             NewShutDwnUPP(userRoutine)
  92. #define CallShutDwnProc(userRoutine, shutDownStage)                InvokeShutDwnUPP(shutDownStage, userRoutine)
  93. EXTERN_API( void )
  94. ShutDwnPower                    (void)                                                        THREEWORDINLINE(0x3F3C, 0x0001, 0xA895);
  95.  
  96. EXTERN_API( void )
  97. ShutDwnStart                    (void)                                                        THREEWORDINLINE(0x3F3C, 0x0002, 0xA895);
  98.  
  99. EXTERN_API( void )
  100. ShutDwnInstall                    (ShutDwnUPP             shutDownProc,
  101.                                  short                     flags)                                THREEWORDINLINE(0x3F3C, 0x0003, 0xA895);
  102.  
  103. EXTERN_API( void )
  104. ShutDwnRemove                    (ShutDwnUPP             shutDownProc)                        THREEWORDINLINE(0x3F3C, 0x0004, 0xA895);
  105.  
  106. #endif  /* CALL_NOT_IN_CARBON */
  107.  
  108.  
  109. #if PRAGMA_STRUCT_ALIGN
  110.     #pragma options align=reset
  111. #elif PRAGMA_STRUCT_PACKPUSH
  112.     #pragma pack(pop)
  113. #elif PRAGMA_STRUCT_PACK
  114.     #pragma pack()
  115. #endif
  116.  
  117. #ifdef PRAGMA_IMPORT_OFF
  118. #pragma import off
  119. #elif PRAGMA_IMPORT
  120. #pragma import reset
  121. #endif
  122.  
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126.  
  127. #endif /* __SHUTDOWN__ */
  128.  
  129.